home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Night Owl 6
/
Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso
/
031a
/
gmai13.zip
/
GMAIL.XWS
< prev
next >
Wrap
Text File
|
1991-10-12
|
11KB
|
355 lines
/*
gMail version 1.3 - G. Gallo
Crosstalk for Windows MarkMail Qmail Automator version 1.3
(c) Guy Gallo, 1991
If you use this script, please register by sending $15.00 to:
219 East 69th Street
New York, NY 10021
You may *not* distribute modified versions of this script, either for a
fee, or for no fee. You may freely distribute the ZIP, as long as it
includes all of the files as originally distributed by me. Any distribution
via other mediums must be approved by me.
*/
STRING Main$, Conf$, cConf$, qMail$, mMail$, qCfig$, Null$, Temp$, ConfigureCommand$
STRING RepName$, QwkName$, DirRep$, DirQwk$, SaveQwk$, DoorCmd$, Reader$, DoCmd$, CurLine$
STRING Board$, Phone$, Ver$, TempQwk$, cMain$
INTEGER MailReplies, MailOnly, RepliesOnly, LogOut, LoadReader, xExec, InConfig
INTEGER ConfigureMail, Icon, Flag, Success, Ask, Auto, NoMail, Reset, InMail, x
Ver$ = "1.3"
--Contants
Board$ = "INV-FAC"
Main$ = "Board Command?"
cMain$ = "Your Command"
Conf$ = "rence Command?"
cConf$ = "Conference - You"
qMail$= "Qmail Command?"
qCfig$= "igure Command?"
mMail$= "kMail Command?"
Null$ = ""
Temp$ = Null$
ConfigureCommand$ is "C"
Reader$ is "WINQWK.EXE"
DoCmd$ is "n s u"
DoorCmd$ is "Qmail4"
if NetId <> Null$ Then DoorCmd$ = NetID
Success = True
InMail = False
--Get defaults from script argument
Temp$ is Arg(0)
Temp$ is Upcase(Temp$)
If Temp$ is Null$ or Temp$ is "/ASK" Then Ask is True : NoMail is True : Goto Start
Flag = 0
if Instr(Temp$, "/MR") Then MailReplies = True : Flag = Flag + 1
if Instr(Temp$, "/MO") and Not MailReplies Then MailOnly = True : Flag = Flag+ 1
if Instr(Temp$, "/RO") and Not MailReplies and Not MailOnly Then RepliesOnly = True : Flag = Flag + 1
if Instr(Temp$, "/NM") and Not MailReplies and Not MailOnly and Not RepliesOnly Then NoMail = True : Flag = Flag +1
if Flag = 0 Then NoMail = True
Flag = 0
if Instr(Temp$, "/ASK") Then Ask = True : Flag = Flag + 1
if Instr(Temp$, "/AUTO") Then Auto = True : Flag = Flag + 1
if Flag = 0 and Not NoMail Then Ask is True
Flag = 0
if Instr(Temp$, "/O") Then LogOut = True : Flag = Flag + 1
if Instr(Temp$, "/DO") Then xExec = True : Flag = Flag + 1
if Flag = 0 Then Logout = False
if Instr(Temp$, "/B:") Then Board$ is Slice(Temp$, 1,"/", Instr(Temp$, "/B:")+3)
if Instr(Temp$, "/DR:") Then DoorCmd$ is Slice(Temp$, 1,"/", Instr(Temp$, "/DR:")+4)
if Instr(Temp$, "/D:") Then DoCmd$ is Slice(Temp$, 1,"/", Instr(Temp$, "/D:")+3)
If Instr(Temp$, "/LR") Then LoadReader = True
if Instr(Temp$, "/R:") Then Reader$ is Slice(Temp$, 1,"/", Instr(Temp$, "/R:")+3)
If Instr(Temp$, "/I") Then Icon = True
If Instr(Temp$, "/CO") Then ConfigureMail = True
If Instr(Temp$, "/C:") Then ConfigureCommand$ is Slice(Temp$, 1,"/", Instr(Temp$, "/C:")+3)
LABEL Start
Message "[gMail] Starting..."
Temp$ = Null$
If Not Online then
{
TRAP ON
If Ask Then Gosub ShowDialog
Load Board$
Phone$ = Number
Temp$ is Script
Script is Null$
Dial Phone$
TRAP OFF
If Not Online Then Script is Temp$ : Save : Halt
Reset is True
}
Wait Quiet 8 Ticks
TRAP ON
Board$ is Name
Reader$ = Reader$ + " " + Board$+".QWK"
if Online Then :...
CurLine$ is WinString(yPos,xPos-21,20)
TRAP OFF
If Error Then {
if Not InMail Then Reply
Message "[gMail] Starting...Error..."
wait quiet 2 ticks
Goto Start
}
If Icon Then Minimize
Message "[gMail] Logging onto "+ Board$
If Instr(CurLine$,"first name?") Then Reply : Goto WatchLoop
If Instr(CurLine$,"cs (Enter)=no?") OR Instr(UpCase(CurLine$),"GRAPHICS") Then Reply "N Q" : Goto WatchLoop
If Instr(CurLine$,"er)=no change?") Then Reply : Goto WatchLoop
If Instr(Curline$,Main$) or Instr(CurLine$,Conf$) or Instr(CurLine$,cMain$) or Instr(CurLine$,cConf$) then Goto DoneLogon
If InStr(Curline$,mMail$) or Instr(CurLine$, qMail$) then
{
InMail is True
If Ask then Gosub ShowDialog
Goto AtMailPrompt
}
LABEL WatchLoop
Message "[gMail] Logon prompts..."
while online
watch for
'first name?' : wait 5 ticks : reply UserID
'last name?' : wait 5 ticks : reply
'first and last' : wait 5 ticks : reply UserID
'correct? (' : Reply "y"
'dots).?',
'echo' : wait 4 ticks : reply Password
'a new user?' : wait 4 ticks : end
'cs (Enter)=no?',
'LOR & GRAPHICS' : wait 4 ticks : Reply "N Q"
'=no?',
'tinue?',
'tinue:',
'stop?',
'(NS)?',
'use (Enter)=no change?',
'More?' : wait 4 ticks : reply
'Check your mail' : reply "N"
'=yes?' : wait 4 ticks : reply "N"
Main$,
cMain$,
Conf$,
cConf$ : Goto DoneLogon
Key 27 : Halt
endwatch
wend
LABEL DoneLogon
If Reset and Online then Script is Temp$ : Save
If Ask Then Gosub ShowDialog
If NoMail Then
{
Wait Quiet 5 Ticks
if xExec Then
{
Reply DoCmd$
Wait Quiet 6 Ticks
Gosub ReturnToPcBoard
}
If Logout Then
{
reply "g"
Message "[gMail] Logging off."
Wait quiet 5 ticks
If LoadReader then Run Reader$
Halt
}
else
{
Alarm
Message "[gMail] Done..."
Halt
}
}
Reply DoorCmd$
WAIT 5 TICKS
--Second Watch loop
LABEL LOOP
While OnLine
Watch For
mMail$,
'<COMMAND>',
qMail$ : Goto AtMailPrompt
Key 27 : Halt
endwatch
Wend
LABEL ShowDialog
Message "[gMail] Set options..."
DIALOGBOX 25, 15, 235, 125
LTEXT 3, 6, 93, 8, "gMail "+ Ver$ + " - calling: /B:"
GROUPBOX 4, 18, 94, 82, "Mail Options"
RADIOBUTTON 6, 28, 86, 10, "&Mail and Replies /MR", MailReplies, tabstop group
RADIOBUTTON 6, 38, 62, 10, "M&ail Only /MO", MailOnly
RADIOBUTTON 6, 48, 64, 10, "&Replies only /RO", RepliesOnly
RADIOBUTTON 6, 58, 87, 10, "&Configure mail door /CO", ConfigureMail
RADIOBUTTON 6, 85, 90, 10, "&No Mail processing /NM", NoMail
EDITTEXT 28, 72, 62, 12, ConfigureCommand$, CONFIGURECOMMAND$
LTEXT 15, 75, 11, 8, "/C:"
LTEXT 3, 106, 100, 8, "Open mail door command /DR:"
EDITTEXT 110, 103, 45, 12, DoorCmd$, DOORCMD$
EDITTEXT 86, 4, 48, 12, Board$, BOARD$
CHECKBOX 148, 5, 81, 10, "&Iconize after logon /I", Icon
GROUPBOX 102, 18, 126, 82, "Post Mail Options"
CHECKBOX 115, 28, 100, 10, "&Do Main Board command /DO", Xexec, tabstop
LTEXT 105, 45, 10, 8, "/D:"
EDITTEXT 115, 42, 110, 12, DoCmd$, DOCMD$, tabstop
CHECKBOX 115, 58, 74, 10, "&Launch Reader /LR", LoadREader, tabstop
LTEXT 105, 70, 11, 8, "/R:"
EDITTEXT 115, 68, 110, 12, Reader$, READER$, tabstop
CHECKBOX 115, 87, 93, 10, "Log &off when complete /O", LogOut, tabstop
DEFPUSHBUTTON 166, 106, 28, 11, "OK"
PushButton 202, 106, 28, 11, "Cancel", Cancel
ENDDIALOG
Message "[gMail] Working..."
Auto is True : Ask is False
If OnLine and Icon Then Minimize
If Choice = 2 Then Halt
RETURN
LABEL AtMailPrompt
InMail is True
InConfig is False
If ConfigureMail Then
{
Reply ConfigureCommand$
Message "[gMail] Select options; Q for gMail menu..."
Wait quiet 5 ticks
InConfig is True
Gosub Cleanup
Auto is False
Ask is true
NoMail is true
ConfigureMail is False
InConfig is False
Goto Start
}
Message "[gMail] At Mail prompt, doing mail..."
InMail is True
RepName$ is NAME+".REP"
QwkName$ is NAME+".QWK"
TmpQwk$ is DirFil+"\"+name+".$$$"
DirRep$ is DirFil+"\"+RepName$
DirQwk$ is DirFil+"\"+QwkName$
SaveQwk$ is DirFil+"\"+inject(QwkName$,"1",1)
if RepliesOnly Then Gosub SendFiles
if MailReplies Then Gosub SendFiles : Gosub GetPacket
if MailOnly Then Gosub GetPacket
If xExec Then
{
Message "[gMail] Executing ExecCommand."
GoSub ReturnToPCBoard
Reply DoCmd$
Wait Quiet 6 Ticks
GoSub ReturnToPCBoard
}
Trap On
If LogOut and InMail Then GoSub CleanUp : Wait 10 Ticks: Reply "G"
If LogOut Then Wait 5 ticks : Reply "G"
Alarm
If LoadReader Then Wait 5 Ticks : Run Reader$
Trap Off
END
LABEL GetPacket
Reply "D"
While OnLine
Watch 10 for
'[Y]es, [N]o, [G]oodbye When Done?',
'<DLASK>',
'(Y/N)?' : Reply "Y": GoSub DoFiles : Goto GPOut
'no messages',
'<NO TRANSFER>' : Message "No Transfer" : Goto GPOut
KEY 27 : Message "Transfer aborted." : Goto GPOut
endwatch
Wend
LABEL GPOut
Return
LABEL DoFiles
if Exists(TmpQwk$) then Delete TmpQwk$
If Exists(SaveQwk$) then Rename SaveQwk$,TmpQwk$
If Exists(DirQwk$) then Rename DirQwk$,SaveQwk$
Message "[gMail] Renaming old QWK..."
Trap ON
Watch for
'(Ctrl-X) Aborts Transfer' : Receive QwkName$ : Gosub CheckSuccess
'<DOWNLOAD>' : Receive QwkName$ : Gosub CheckSuccess
endwatch
If Success Then
{
If Exists(TmpQwk$) Then Delete TmpQwk$
Message "[gMail] Transfer complete."
}
else
{
Delete DirQwk$
if Exists(SaveQwk$) then Rename SaveQwk$, DirQwk$
if Exists(TmpQwk$) then Rename TmpQwk$, SaveQwk$
Message "[gMail] Transfer failed!"
}
TRAP OFF
Return
LABEL SendFiles
If exists(DirRep$) then
{
Reply "U"
Wait 5 ticks
TRAP ON
Send RepName$
GoSub CheckSuccess
if Success Then Delete DirRep$ : Message "[gMail] Deleting reply file..." :...
Else Message "Keeping REP file"
TRAP OFF
}
Return
LABEL CleanUp
While OnLine
Watch For
mMail$,
'<COMMAND>',
qMail$ : Message "[gMail] Done with mail..." : Goto CUOut
key 27 : Halt
endwatch
-- If TimeOut And InConfig = 0 then reply
Wend
LABEL CUOut
Return
LABEL ReturnToPCBoard
Message "[gMail] Returning to PCBoard..."
x = 0
if InMail Then Reply "q" : InMail is False
While OnLine
Watch 14 For
Main$,
Conf$,
cMain$ : Message "[gMail] Back at PCBoard." : Goto RTPOut
Key 27 : Halt
'password' : Reply PassWord
EndWatch
If TimeOut Then Reply : x = x + 1
if x > 10 Then Bye : Halt
Wend
LABEL RTPOut
Return
LABEL CheckSuccess
Success is True
If Error Then...
If ErrClass = 45 or ErrClass = 20 Then Success = False
Return
LABEL DoRec
If Protocol <> "ZMODEM" Then Receive QwkName$
Return